<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .tab {
      width: 500px;
      height: 500px;
      border: 1px solid #000;
      margin: 0;
      /* overflow: hidden; */
    }

    .tab .tab-wrapper {
      height: 50px;
      border-bottom: 1px solid #000;
    }

    .tab .tab-wrapper .tab-item {
      float: left;
      width: 25%;
      height: 100%;
      text-align: center;
      line-height: 50px;
    }

    .tab .tab-item .active {
      background-color: #000;
      color: #fff;
    }

    .tab .page-wrapper {
      position: relative;
      height: 450px;
    }

    .tab.fade .inner {
      position: relative;
      width: 100%;
      height: 100%;
    }

    .tab.slide .inner {
      position: absolute;
      top: 0;
      left: 0;
      width: 2000px;
      height: 100%;
      transition: transform .3s;
    }

    .tab .page-item {
      width: 500px;
      height: 100%;
      text-align: center;
      line-height: 450px;
      font-size: 100px;
    }

    .tab.fade .page-item {
      display: none;
      position: absolute;
      top: 0;
      left: 0;
    }

    .tab.fade .page-item.active {
      display: block;
    }

    .tab.slide .page-item {
      float: left;
      display: block;
      width: 500px;
      height: 100%;
    }
  </style>
</head>

<body>

  <div class="tab">
    <div class="tab-wrapper">
      <div class="tab-item active">选项1</div>
      <div class="tab-item">选项2</div>
      <div class="tab-item">选项3</div>
      <div class="tab-item">选项4</div>
    </div>
    <div class="page-wrapper">
      <div class="inner">
        <div class="page-item active">页面1</div>
        <div class="page-item">页面2</div>
        <div class="page-item">页面3</div>
        <div class="page-item">页面4</div>
      </div>
    </div>
  </div>

  <script type="module" src="./src/index.ts"></script>
</body>

</html>